/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package telas;

import java.awt.Color;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import vacina.Vacina;
import vacina.VacinaDAO;

/**
 *
 * @author Max Weber
 */
public class O12TelaExibirVacina extends javax.swing.JFrame {

    /**
     * Creates new form O10TelaConsultarVacinas
     */
    Vacina vacina = new Vacina();
    private O12TelaExibirVacina() {
        initComponents();
    }

    public O12TelaExibirVacina(Vacina vacina) {
        initComponents();
        tfNomeVacina.setText(vacina.getNome_vacina());
        jcParticular.setSelected(vacina.isDispParticular());
        jcPublica.setSelected(vacina.isDispPublica());
        tfDoencasEvitadas.setText(vacina.getDoencas_evitadas());
        tfObservacoes.setText(vacina.getObservacoes());
        tfInformacoes.setText(vacina.getInformacoes());
        
        tfSalvar.setEnabled(false);
        iconSalvar.setEnabled(false);
        btSalvar.setEnabled(false);

        desabilitarCampos();
        this.vacina = vacina;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bgEntrou = new javax.swing.JLabel();
        bgSaiu = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        painelFechar = new javax.swing.JPanel();
        btFechar = new javax.swing.JLabel();
        btMaxi = new javax.swing.JLabel();
        btMini = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        tfNomeVacina = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jcParticular = new javax.swing.JCheckBox();
        jcPublica = new javax.swing.JCheckBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        tfDoencasEvitadas = new javax.swing.JTextArea();
        jLabel6 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tfInformacoes = new javax.swing.JTextArea();
        jLabel8 = new javax.swing.JLabel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tfObservacoes = new javax.swing.JTextArea();
        jLabel7 = new javax.swing.JLabel();
        btSalvar = new javax.swing.JPanel();
        iconSalvar = new javax.swing.JLabel();
        tfSalvar = new javax.swing.JLabel();
        btCancelar = new javax.swing.JPanel();
        iconCancelar = new javax.swing.JLabel();
        tfCancelar = new javax.swing.JLabel();
        btEditar = new javax.swing.JPanel();
        iconEditar = new javax.swing.JLabel();
        tfEditar = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();

        bgEntrou.setBackground(new java.awt.Color(68, 165, 237));
        bgEntrou.setText("jLabel4");

        bgSaiu.setBackground(new java.awt.Color(10, 66, 108));
        bgSaiu.setText("jLabel4");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setUndecorated(true);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanel1.setBackground(new java.awt.Color(0, 114, 180));
        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204)));

        jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/icone_barraDeTit.png"))); // NOI18N

        painelFechar.setBackground(new java.awt.Color(128, 128, 128));
        painelFechar.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseMoved(java.awt.event.MouseEvent evt) {
                painelFecharMouseMoved(evt);
            }
        });
        painelFechar.addMouseWheelListener(new java.awt.event.MouseWheelListener() {
            public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
                painelFecharMouseWheelMoved(evt);
            }
        });
        painelFechar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                painelFecharMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                painelFecharMouseExited(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                painelFecharMousePressed(evt);
            }
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                painelFecharMouseReleased(evt);
            }
        });

        btFechar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/fechar.png"))); // NOI18N
        btFechar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btFecharMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btFecharMouseEntered(evt);
            }
        });

        javax.swing.GroupLayout painelFecharLayout = new javax.swing.GroupLayout(painelFechar);
        painelFechar.setLayout(painelFecharLayout);
        painelFecharLayout.setHorizontalGroup(
            painelFecharLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(painelFecharLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btFechar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        painelFecharLayout.setVerticalGroup(
            painelFecharLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, painelFecharLayout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addComponent(btFechar)
                .addGap(3, 3, 3))
        );

        btMaxi.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/maximizar.png"))); // NOI18N

        btMini.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/minimizar.png"))); // NOI18N

        jPanel2.setBackground(new java.awt.Color(255, 255, 255));
        jPanel2.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel4.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
        jLabel4.setText("Nome da vacina:");
        jPanel2.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 30, -1, -1));

        tfNomeVacina.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
        jPanel2.add(tfNomeVacina, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 60, 350, -1));

        jLabel5.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
        jLabel5.setText("Disponibilidade:");
        jPanel2.add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 120, -1, -1));

        jcParticular.setBackground(new java.awt.Color(255, 255, 255));
        jcParticular.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
        jcParticular.setText("Clínica particular");
        jPanel2.add(jcParticular, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 150, -1, -1));

        jcPublica.setBackground(new java.awt.Color(255, 255, 255));
        jcPublica.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
        jcPublica.setText("Unidade Pública");
        jPanel2.add(jcPublica, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 180, -1, -1));

        tfDoencasEvitadas.setColumns(20);
        tfDoencasEvitadas.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
        tfDoencasEvitadas.setLineWrap(true);
        tfDoencasEvitadas.setRows(5);
        jScrollPane1.setViewportView(tfDoencasEvitadas);

        jPanel2.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 150, 220, 70));

        jLabel6.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
        jLabel6.setText("Doenças evitadas:");
        jPanel2.add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 120, -1, -1));

        tfInformacoes.setColumns(20);
        tfInformacoes.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
        tfInformacoes.setLineWrap(true);
        tfInformacoes.setRows(5);
        jScrollPane4.setViewportView(tfInformacoes);

        jPanel2.add(jScrollPane4, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 270, 220, 70));

        jLabel8.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
        jLabel8.setText("Informações:");
        jPanel2.add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 240, -1, -1));

        tfObservacoes.setColumns(20);
        tfObservacoes.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
        tfObservacoes.setLineWrap(true);
        tfObservacoes.setRows(5);
        jScrollPane2.setViewportView(tfObservacoes);

        jPanel2.add(jScrollPane2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 270, 220, 70));

        jLabel7.setFont(new java.awt.Font("Arial", 0, 18)); // NOI18N
        jLabel7.setText("Observações:");
        jPanel2.add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 240, -1, -1));

        btSalvar.setBackground(new java.awt.Color(10, 66, 108));
        btSalvar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btSalvarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btSalvarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btSalvarMouseExited(evt);
            }
        });
        btSalvar.setLayout(new java.awt.GridBagLayout());

        iconSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/SAVE.png"))); // NOI18N
        iconSalvar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconSalvarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                iconSalvarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                iconSalvarMouseExited(evt);
            }
        });
        btSalvar.add(iconSalvar, new java.awt.GridBagConstraints());

        tfSalvar.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
        tfSalvar.setForeground(new java.awt.Color(255, 255, 255));
        tfSalvar.setText("  Salvar");
        tfSalvar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tfSalvarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                tfSalvarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                tfSalvarMouseExited(evt);
            }
        });
        btSalvar.add(tfSalvar, new java.awt.GridBagConstraints());

        jPanel2.add(btSalvar, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 360, 110, 30));

        btCancelar.setBackground(new java.awt.Color(10, 66, 108));
        btCancelar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btCancelarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btCancelarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btCancelarMouseExited(evt);
            }
        });
        btCancelar.setLayout(new java.awt.GridBagLayout());

        iconCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/fecharBT.png"))); // NOI18N
        iconCancelar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconCancelarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                iconCancelarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                iconCancelarMouseExited(evt);
            }
        });
        btCancelar.add(iconCancelar, new java.awt.GridBagConstraints());

        tfCancelar.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
        tfCancelar.setForeground(new java.awt.Color(255, 255, 255));
        tfCancelar.setText("  Cancelar");
        tfCancelar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tfCancelarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                tfCancelarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                tfCancelarMouseExited(evt);
            }
        });
        btCancelar.add(tfCancelar, new java.awt.GridBagConstraints());

        jPanel2.add(btCancelar, new org.netbeans.lib.awtextra.AbsoluteConstraints(380, 360, 110, 30));

        btEditar.setBackground(new java.awt.Color(10, 66, 108));
        btEditar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                btEditarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                btEditarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btEditarMouseExited(evt);
            }
        });
        btEditar.setLayout(new java.awt.GridBagLayout());

        iconEditar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/edit.png"))); // NOI18N
        iconEditar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                iconEditarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                iconEditarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                iconEditarMouseExited(evt);
            }
        });
        btEditar.add(iconEditar, new java.awt.GridBagConstraints());

        tfEditar.setFont(new java.awt.Font("Arial", 1, 16)); // NOI18N
        tfEditar.setForeground(new java.awt.Color(255, 255, 255));
        tfEditar.setText("  Editar");
        tfEditar.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tfEditarMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                tfEditarMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                tfEditarMouseExited(evt);
            }
        });
        btEditar.add(tfEditar, new java.awt.GridBagConstraints());

        jPanel2.add(btEditar, new org.netbeans.lib.awtextra.AbsoluteConstraints(170, 360, 110, 30));

        jLabel2.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 18)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Exibir vacina");

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/img/TitconsultarVacinas.png"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel2)
                        .addGap(104, 104, 104)
                        .addComponent(btMini)
                        .addGap(5, 5, 5)
                        .addComponent(btMaxi)
                        .addGap(5, 5, 5)
                        .addComponent(painelFechar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(3, 3, 3))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(3, 3, 3)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(painelFechar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3)
                        .addComponent(jLabel2)
                        .addComponent(jLabel1))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btMaxi)
                            .addComponent(btMini))
                        .addGap(5, 5, 5)))
                .addGap(3, 3, 3)
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(3, 3, 3))
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 520, 440));

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void painelFecharMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_painelFecharMouseReleased

    }//GEN-LAST:event_painelFecharMouseReleased

    private void painelFecharMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_painelFecharMousePressed
        
    }//GEN-LAST:event_painelFecharMousePressed

    private void painelFecharMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_painelFecharMouseExited
        // TODO add your handling code here:
        painelFechar.setBackground(Color.gray);

    }//GEN-LAST:event_painelFecharMouseExited

    private void painelFecharMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_painelFecharMouseEntered
        // TODO add your handling code here:
        painelFechar.setBackground(Color.red);
    }//GEN-LAST:event_painelFecharMouseEntered

    private void painelFecharMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_painelFecharMouseWheelMoved

    }//GEN-LAST:event_painelFecharMouseWheelMoved

    private void painelFecharMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_painelFecharMouseMoved

    }//GEN-LAST:event_painelFecharMouseMoved

    private void btFecharMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btFecharMouseEntered
        // TODO add your handling code here:
        painelFechar.setBackground(Color.red);
    }//GEN-LAST:event_btFecharMouseEntered

    private void btFecharMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btFecharMouseClicked
        O10TelaConsultarVacinas tela = new O10TelaConsultarVacinas();
        tela.setVisible(true);
        dispose();
    }//GEN-LAST:event_btFecharMouseClicked

    private void iconSalvarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconSalvarMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_iconSalvarMouseClicked

    private void iconSalvarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconSalvarMouseEntered
        bgEntra(btSalvar);
    }//GEN-LAST:event_iconSalvarMouseEntered

    private void iconSalvarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconSalvarMouseExited
       bgSai(btSalvar);
    }//GEN-LAST:event_iconSalvarMouseExited

    private void tfSalvarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfSalvarMouseClicked
        vacina.setNome_vacina(tfNomeVacina.getText());
        vacina.setDispParticular(jcParticular.isSelected());
        vacina.setDispPublica(jcPublica.isSelected());
        vacina.setDoencas_evitadas(tfDoencasEvitadas.getText());
        vacina.setObservacoes(tfObservacoes.getText());
        vacina.setInformacoes(tfInformacoes.getText());
        
        VacinaDAO dao = new VacinaDAO();
        dao.atualizar(vacina);
        
        desabilitarCampos();
        tfSalvar.setEnabled(false);
        iconSalvar.setEnabled(false);
        btSalvar.setEnabled(false);
        
        tfEditar.setEnabled(true);
        iconEditar.setEnabled(true);
        btEditar.setEnabled(true);
        
        
        JOptionPane.showMessageDialog(rootPane, "Vacina atualizada com sucesso!");
        
    }//GEN-LAST:event_tfSalvarMouseClicked

    private void tfSalvarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfSalvarMouseEntered
       bgEntra(btSalvar);
    }//GEN-LAST:event_tfSalvarMouseEntered

    private void tfSalvarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfSalvarMouseExited
        bgSai(btSalvar);
    }//GEN-LAST:event_tfSalvarMouseExited

    private void btSalvarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btSalvarMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_btSalvarMouseClicked

    private void btSalvarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btSalvarMouseEntered
        bgEntra(btSalvar);
    }//GEN-LAST:event_btSalvarMouseEntered

    private void btSalvarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btSalvarMouseExited
        bgSai(btSalvar);
    }//GEN-LAST:event_btSalvarMouseExited

    private void iconCancelarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconCancelarMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_iconCancelarMouseClicked

    private void iconCancelarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconCancelarMouseEntered
        // TODO add your handling code here:
        bgEntra(btCancelar);
    }//GEN-LAST:event_iconCancelarMouseEntered

    private void iconCancelarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconCancelarMouseExited
        // TODO add your handling code here:
        bgSai(btCancelar);
    }//GEN-LAST:event_iconCancelarMouseExited

    private void tfCancelarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfCancelarMouseClicked
        O10TelaConsultarVacinas tela = new O10TelaConsultarVacinas();
        tela.setVisible(true);
        dispose();
    }//GEN-LAST:event_tfCancelarMouseClicked

    private void tfCancelarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfCancelarMouseEntered
        // TODO add your handling code here:
        bgEntra(btCancelar);
    }//GEN-LAST:event_tfCancelarMouseEntered

    private void tfCancelarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfCancelarMouseExited
        // TODO add your handling code here:
        bgSai(btCancelar);
    }//GEN-LAST:event_tfCancelarMouseExited

    private void btCancelarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btCancelarMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_btCancelarMouseClicked

    private void btCancelarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btCancelarMouseEntered
        // TODO add your handling code here:
        bgEntra(btCancelar);
    }//GEN-LAST:event_btCancelarMouseEntered

    private void btCancelarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btCancelarMouseExited
        // TODO add your handling code here:
        bgSai(btCancelar);
    }//GEN-LAST:event_btCancelarMouseExited

    private void iconEditarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconEditarMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_iconEditarMouseClicked

    private void iconEditarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconEditarMouseEntered
        // TODO add your handling code here:
        bgEntra(btEditar);
    }//GEN-LAST:event_iconEditarMouseEntered

    private void iconEditarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_iconEditarMouseExited
        // TODO add your handling code here:
        bgSai(btEditar);
    }//GEN-LAST:event_iconEditarMouseExited

    private void tfEditarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfEditarMouseClicked
        // TODO add your handling code here:
        tfEditar.setEnabled(false);
        iconEditar.setEnabled(false);
        btEditar.setEnabled(false);
        habilitarCampos();
        tfSalvar.setEnabled(true);
        iconSalvar.setEnabled(true);
        btSalvar.setEnabled(true);
    }//GEN-LAST:event_tfEditarMouseClicked

    private void tfEditarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfEditarMouseEntered
        // TODO add your handling code here:
        bgEntra(btEditar);
    }//GEN-LAST:event_tfEditarMouseEntered

    private void tfEditarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tfEditarMouseExited
        // TODO add your handling code here:
        bgSai(btEditar);
    }//GEN-LAST:event_tfEditarMouseExited

    private void btEditarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btEditarMouseClicked
        // TODO add your handling code here:
        
    }//GEN-LAST:event_btEditarMouseClicked

    private void btEditarMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btEditarMouseEntered
        // TODO add your handling code here:
        bgEntra(btEditar);
        
    }//GEN-LAST:event_btEditarMouseEntered

    private void btEditarMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btEditarMouseExited
        // TODO add your handling code here:
        bgSai(btEditar);
    }//GEN-LAST:event_btEditarMouseExited
    
    private void bgEntra(JPanel painel) {
        painel.setBackground(bgEntrou.getBackground());
    }

    private void bgSai(JPanel painel) {
        painel.setBackground(bgSaiu.getBackground());
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(O12TelaExibirVacina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(O12TelaExibirVacina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(O12TelaExibirVacina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(O12TelaExibirVacina.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new O12TelaExibirVacina().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel bgEntrou;
    private javax.swing.JLabel bgSaiu;
    private javax.swing.JPanel btCancelar;
    private javax.swing.JPanel btEditar;
    private javax.swing.JLabel btFechar;
    private javax.swing.JLabel btMaxi;
    private javax.swing.JLabel btMini;
    private javax.swing.JPanel btSalvar;
    private javax.swing.JLabel iconCancelar;
    private javax.swing.JLabel iconEditar;
    private javax.swing.JLabel iconSalvar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JCheckBox jcParticular;
    private javax.swing.JCheckBox jcPublica;
    private javax.swing.JPanel painelFechar;
    private javax.swing.JLabel tfCancelar;
    private javax.swing.JTextArea tfDoencasEvitadas;
    private javax.swing.JLabel tfEditar;
    private javax.swing.JTextArea tfInformacoes;
    private javax.swing.JTextField tfNomeVacina;
    private javax.swing.JTextArea tfObservacoes;
    private javax.swing.JLabel tfSalvar;
    // End of variables declaration//GEN-END:variables

    private void desabilitarCampos() {
        tfNomeVacina.setEnabled(false);
        jcParticular.setEnabled(false);
        jcPublica.setEnabled(false);
        tfDoencasEvitadas.setEnabled(false);
        tfObservacoes.setEnabled(false);
        tfInformacoes.setEnabled(false);

    }

    private void habilitarCampos() {
        tfNomeVacina.setEnabled(true);
        jcParticular.setEnabled(true);
        jcPublica.setEnabled(true);
        tfDoencasEvitadas.setEnabled(true);
        tfObservacoes.setEnabled(true);
        tfInformacoes.setEnabled(true);
    }
}
